.TH std::basic_regex::operator= 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::basic_regex::operator= \- std::basic_regex::operator=

.SH Synopsis
   Defined in header <regex>
   basic_regex& operator=( const basic_regex& other );                \fB(1)\fP \fI(since C++11)\fP
   basic_regex& operator=( basic_regex&& other ) noexcept;            \fB(2)\fP \fI(since C++11)\fP
   basic_regex& operator=( const CharT* ptr );                        \fB(3)\fP \fI(since C++11)\fP
   basic_regex& operator=( std::initializer_list<CharT> il );         \fB(4)\fP \fI(since C++11)\fP
   template< class ST, class SA >                                     \fB(5)\fP \fI(since C++11)\fP
   basic_regex& operator=( const std::basic_string<CharT,ST,SA>& p );

   Assigns the contents.

   1) Copy assignment operator. Assigns the contents of other. Equivalent to
   assign(other);.
   2) Move assignment operator. Assigns the contents of other using move semantics.
   other is in valid, but unspecified state after the operation. Equivalent to
   assign(other);.
   3) Assigns a null-terminated character string pointed to by ptr. Equivalent to
   assign(ptr);.
   4) Assigns characters contained in initializer list il. Equivalent to assign(il);.
   5) Assigns the contents of the string p. Equivalent to assign(p);.

.SH Parameters

   other - another regex object
   ptr   - pointer to a null-terminated character string
   il    - initializer list containing characters to assign
   p     - string containing characters to assign

.SH Return value

   *this

.SH Exceptions

   1) May throw implementation-defined exceptions.
   3-5) std::regex_error if the supplied regular expression is not valid. The object is
   not modified in that case.

.SH See also

   assign assigns the contents
          \fI(public member function)\fP
